#ifndef MAINWIDGET_H
#define MAINWIDGET_H

#include <QTableWidget>
#include <QHBoxLayout>
#include <QLabel>
#include <QPushButton>
#include <QSpacerItem>
#include "VideoPlatform.h"

QT_BEGIN_NAMESPACE

namespace Ui {
    class MainWidget;
}

QT_END_NAMESPACE

class MainWidget final : public QWidget {
    Q_OBJECT

public:
    explicit MainWidget(QWidget *parent = nullptr);

    ~MainWidget() override;

private:
    Ui::MainWidget *ui;
    VideoPlatform platform;
    QTableWidget *pTableWidget{nullptr};
    QMap<Qt::DayOfWeek, std::tuple<QString, QString> > dayOfWeekMap;
    QList<std::tuple<QWidget *, QHBoxLayout *, QString, QString> > pWidgetTupleList{};
    QHBoxLayout *readHorizontalLayout{};
    QLabel *readLabel{};
    QPushButton *readPushButton{};
    QSpacerItem *readHorizontalSpacer{};
    QWidget *readWidget{};

    void Init();

    int PlatformOneDay(int row, const Qt::DayOfWeek &dayOfWeek, const QString &tableName);

private slots:
    void CurrentTabChanged(int index);

    void CurrentTabFresh();
};

#endif // MAINWIDGET_H
